package com.dnjn.happiness.system.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;

import com.dnjn.happiness.common.core.domain.R;
import com.dnjn.happiness.common.core.model.SysSiteVO;
import com.dnjn.happiness.system.api.factory.RemoteSiteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;


@FeignClient(contextId = "remoteSiteService",value = ServiceNameConstants.SYSTEM_SERVICE,fallbackFactory = RemoteSiteFallbackFactory.class)
public interface RemoteSiteService {

    @GetMapping("/sysSite/getInfoById/{siteId}")
    public R<SysSiteVO> getInfoById(@PathVariable("siteId") Long siteId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @GetMapping("/sysSite/getSiteList")
    public R<List<SysSiteVO>> getSiteList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
